#include<cstdio>

int main()
{
	int a[100][100];
	int i,j,n,m;
	scanf("%d",&n);
	for (i=1;i<=n;i++)
		for (j=1;j<=n;j++)
			scanf("%d",&a[i][j]);
	printf("\n");
	for (i=1;i<=n;i++)
		for (j=1;j<=i;j++)
		{
			m=a[i][j];
			a[i][j]=a[j][i];
			a[j][i]=m;
		}
	for (i=1;i<=n;i++)
	{
		for (j=1;j<=n;j++)
			printf("%d ",a[i][j]);
		printf("\n");
	}
}
